package net.lijingye.education.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Created by LijingYe on 2016/4/5.
 */
@Entity
@Table(name = "assignment")
public class Assignment implements Serializable {
    @Id
    @Column(name = "assignmentId")
    private String id;
    @Column(name = "title")
    private String title;
    @Column(name = "content")
    private String content;
    @Column(name = "startDate")
    private Date time;
    @Column(name = "endDate")
    private Date endTime;
    @Column(name = "needSubmit")
    private boolean isNeedSubmit;
    @Column(name = "answer")
    private String answer;
    @OneToOne
    @JoinColumn(name = "classId")
    private Lesson lesson;
    @OneToMany
    @JoinColumn(name = "assignmentId")
    private List<StudentAssignment> studentAssignmentList;

    public Assignment() {
    }

    public Assignment(String id, String title, String content, Date time, Date endTime, boolean isNeedSubmit, String answer, Lesson lesson, List<StudentAssignment> studentAssignmentList) {
        this.id = id;
        this.title = title;
        this.content = content;
        this.time = time;
        this.endTime = endTime;
        this.isNeedSubmit = isNeedSubmit;
        this.answer = answer;
        this.lesson = lesson;
        this.studentAssignmentList = studentAssignmentList;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public boolean isNeedSubmit() {
        return isNeedSubmit;
    }

    public void setNeedSubmit(boolean needSubmit) {
        isNeedSubmit = needSubmit;
    }

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    public Lesson getLesson() {
        return lesson;
    }

    public void setLesson(Lesson lesson) {
        this.lesson = lesson;
    }

    public List<StudentAssignment> getStudentAssignmentList() {
        return studentAssignmentList;
    }

    public void setStudentAssignmentList(List<StudentAssignment> studentAssignmentList) {
        this.studentAssignmentList = studentAssignmentList;
    }
}
